package com.yami.shop.personnft.platform.controller;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.PersonNftApply;
import com.yami.shop.bean.model.ProdNft;
import com.yami.shop.bean.model.Product;
import com.yami.shop.bean.model.User;
import com.yami.shop.common.exception.YamiShopBindException;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.personnft.common.model.TransferBatchApply;
import com.yami.shop.personnft.common.service.PersonNftApplyService;
import com.yami.shop.personnft.common.service.TransferBatchApplyService;
import com.yami.shop.service.ProdNftService;
import com.yami.shop.service.ProductService;
import com.yami.shop.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

/**
 * spu信息
 *
 * @author FrozenWatermelon
 * @date 2020-10-28 15:27:24
 */
@RestController("adminTransferBatchApplyController")
@RequestMapping("/admin/batchApply")
@Tag(name = "admin-batchApply信息")
@Slf4j
public class TransferBatchApplyController {
	@Autowired
	private TransferBatchApplyService transferBatchApplyService;

	@GetMapping("/selectListPage")
	@Operation(summary =  "获取平台信息列表", description = "分页获取平台信息列表")
	public ServerResponseEntity<IPage<TransferBatchApply>> selectListPage(PageParam pageDTO, TransferBatchApply transferBatchApply) {
		transferBatchApply.setOrderBy("1");
		IPage<TransferBatchApply> page = transferBatchApplyService.selectPageList(pageDTO, transferBatchApply);
		return ServerResponseEntity.success(page);
	}

	@GetMapping("/removeTimes")
	@Operation(summary =  "获取平台信息列表", description = "分页获取平台信息列表")
	public ServerResponseEntity<TransferBatchApply> removeTimes(Long batchId) {
		transferBatchApplyService.updateTimesByBatchId(batchId);
		return ServerResponseEntity.success();
	}

}
